import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from scipy.optimize import minimize

data = loadmat('data/ex5data1.mat')
# 训练集
X_train, y_train = data['X'], data['y']
X_train = np.insert(X_train, 0, values=1, axis=1)
for i in (2, 3):
    X_train = np.insert(X_train, i, values=np.power(X_train[:, 1], i), axis=1)
print(X_train.shape)
print(X_train)
